class_name MultiwayStateTransition
extends GameplayStateTransition

##
var dimensions: Array[Callable]

##
var state_map: Dictionary


func _init(init_dimensions: Array[Callable], init_state_map: Dictionary) -> void:
	dimensions = init_dimensions
	state_map = init_state_map


func _try_condition() -> bool:
	return true


func _try_transition() -> String:
	var coordinate: Array[int] = []
	
	for dimension: Callable in dimensions:
		coordinate.append(dimension.call())
		
	assert(state_map.has(coordinate), "State map does not have the coordinate: {}!".format(coordinate))

	return state_map[coordinate]


func _on_transit() -> void:
	pass
